#include <stdio.h>
#include <math.h>

int test_array[10] = {1, 2, 43, 34, 5, 6, 7, 8, 9, 10};

int array_max(int *ptr, int len)
{
    int max = ptr[0];
    for (int i = 1; i < len; i++)
    {
        if(ptr[i] >= max)
        {
            max = ptr[i];
        }
    }

    return max;
}

int main(int argc, char *argv[])
{
    printf("max is %d\r\n", array_max(test_array, 10));

    return 0;
}
